package Extend;

public class test1 {
    public static void main(String[] args) {
        Dog dog=new Dog();
        dog.eat();
        dog.run();
        Cat cat=new Cat();
        cat.eat();
        cat.sleep();
    }
}
class Animal{
    public void eat(){
        System.out.println("吃饭");
    }
}
class Dog extends Animal{
    public void run(){
        System.out.println("狗狗正在跑");
    }
}
class Cat extends Animal{
    public void sleep(){
        System.out.println("猫猫正在睡觉");
    }
}